package io.github.talelin.latticy.entity;

import io.github.talelin.latticy.common.CommonUtil;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.annotations.Where;
import org.springframework.context.annotation.Lazy;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

@Entity
@Setter
@Getter
@Table(name = "lin_user")
@Where(clause = "delete_time is null")
public class User extends BaseEntity {
    @Id
    private Long id;
    private String nickname;
    private String avatar;
    private String name;

    @OneToMany(fetch = FetchType.LAZY)
    @JoinColumn(name = "userId")
    @OrderBy("createTime desc ")
    @NotFound(action= NotFoundAction.IGNORE)
    private List<Job> jobList;


}
